package com.example.music;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

public class MainActivity extends AppCompatActivity {
    private FragmentManager fm;
    private FragmentTransaction ft;
    private View view;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ListView listView=findViewById(R.id.lv);

    }

    //这里是创建一个自定义适配器，可以作为模板

    public void onClick(View view) {
        switch (view.getId()) {
//            case R.id.linearLayout1:
//                mediaPlayer = MediaPlayer.create(this, R.raw.music_0);
//                Intent intent3 = new Intent(MainActivity.this, MusicActivity.class);
//                intent3.putExtra("position", "1");
//                startActivity(intent3);
//                mediaPlayer.start();
//                break;
//
//            case R.id.linearLayout2:
//                MediaPlayer mediaPlayer1 = MediaPlayer.create(this, R.raw.music_1);
//                Intent intent4 = new Intent(MainActivity.this, MusicActivity2.class);
//                intent4.putExtra("position", "2");
//                startActivity(intent4);
//                mediaPlayer1.start();
//                break;
        }
    }
}